//
//  YWMaterialPopListTableViewController.m
//  maintain
//
//  Created by 烟雨云渊 on 16/9/1.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWMaterialPopListTableViewController.h"
#import "YWMaterial.h"
#import "YWMaterialApplyDetail.h"
#import "YWMaterialStock.h"
#import "YWMacro.h"
#import "UIColor+CustomColors.h"
#import "UIImage+Extension.h"

@interface YWMaterialPopListTableViewController ()
@property (nonatomic, strong) UIView * footView;
@property (nonatomic, strong) UIButton * certurnBtn;
@end

@implementation YWMaterialPopListTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.rowHeight = 40;
    self.tableView.tableFooterView = [[UIView alloc] init];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    NSInteger count = self.materialsReturn.count;
    return count;
}

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
    static NSString* CellIdentifier = @"YWMaterialPopListTableViewControllerCellIdentifier";
    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    YWMaterialApplyDetail * applyDetail= self.materialsReturn[indexPath.row];
    cell.textLabel.text = [NSString stringWithFormat:@"%@(%@)%ld",applyDetail.materialStock.materialInfo.materialName,applyDetail.materialStock.materialInfo.brand,(long)applyDetail.quantity];
    cell.accessoryType = UITableViewCellAccessoryNone;
    return cell;
}

@end
